<!-- templates/base.html -->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{.title}} - 文章生成系统</title>
    <!-- Tailwind CSS -->
    <script src="/storage/static/js/tailwindcss.3.4.16.js"></script>
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/storage/static/css/all.min.css">
    <!-- Custom CSS -->
    <link rel="stylesheet" href="/storage/static/css/style.css">
    {{block "head" .}}{{end}}
</head>
<body class="bg-gray-50">
    <div class="min-h-screen flex flex-col">
        {{if .showHeader}}
        <header class="bg-white shadow-sm">
            <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
                <div class="flex justify-between h-16">
                    <div class="flex">
                        <div class="flex-shrink-0 flex items-center">
                            <i class="fas fa-robot text-blue-600 text-2xl mr-2"></i>
                            <span class="text-xl font-semibold text-gray-800">文章生成系统</span>
                        </div>
                        <nav class="hidden sm:ml-6 sm:flex sm:space-x-8">
                            <a href="/dashboard" class="inline-flex items-center px-1 pt-1 text-sm font-medium {{if eq .active "dashboard"}}text-blue-600 border-b-2 border-blue-600{{else}}text-gray-500 hover:text-gray-700 hover:border-gray-300{{end}}">
                                <i class="fas fa-chart-line mr-1"></i>仪表盘
                            </a>
                            <a href="/generate" class="inline-flex items-center px-1 pt-1 text-sm font-medium {{if eq .active "generate"}}text-blue-600 border-b-2 border-blue-600{{else}}text-gray-500 hover:text-gray-700 hover:border-gray-300{{end}}">
                                <i class="fas fa-magic mr-1"></i>文章生成
                            </a>
                            <a href="/history" class="inline-flex items-center px-1 pt-1 text-sm font-medium {{if eq .active "history"}}text-blue-600 border-b-2 border-blue-600{{else}}text-gray-500 hover:text-gray-700 hover:border-gray-300{{end}}">
                                <i class="fas fa-history mr-1"></i>历史记录
                            </a>
                            <a href="/settings" class="inline-flex items-center px-1 pt-1 text-sm font-medium {{if eq .active "settings"}}text-blue-600 border-b-2 border-blue-600{{else}}text-gray-500 hover:text-gray-700 hover:border-gray-300{{end}}">
                                <i class="fas fa-cog mr-1"></i>系统设置
                            </a>
                        </nav>
                    </div>
                    <div class="flex items-center">
                        <div class="ml-3 relative">
                            <div class="flex items-center">
                                <span class="text-sm text-gray-700 mr-4">{{.userName}}</span>
                                <a href="/logout" class="text-gray-500 hover:text-gray-700">
                                    <i class="fas fa-sign-out-alt"></i>
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </header>
        {{end}}
        
        <main class="flex-grow">
            {{block "content" .}}{{end}}
        </main>
        
        <footer class="bg-white border-t border-gray-200">
            <div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
                <p class="text-center text-sm text-gray-500">
                    <i class="fas fa-code mr-1"></i>文章生成系统 &copy; {{.currentYear}}
                </p>
            </div>
        </footer>
    </div>

    <!-- Mobile menu -->
    <div class="sm:hidden" id="mobile-menu">
        <div class="pt-2 pb-3 space-y-1">
            <a href="/dashboard" class="block pl-3 pr-4 py-2 text-base font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50">
                <i class="fas fa-chart-line mr-2"></i>仪表盘
            </a>
            <a href="/generate" class="block pl-3 pr-4 py-2 text-base font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50">
                <i class="fas fa-magic mr-2"></i>文章生成
            </a>
            <a href="/history" class="block pl-3 pr-4 py-2 text-base font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50">
                <i class="fas fa-history mr-2"></i>历史记录
            </a>
            <a href="/settings" class="block pl-3 pr-4 py-2 text-base font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50">
                <i class="fas fa-cog mr-2"></i>系统设置
            </a>
        </div>
    </div>

    <!-- Custom JS -->
    <script src="/storage/static/js/main.js"></script>
    {{block "scripts" .}}{{end}}
</body>
</html>